#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

load("@io_bazel_rules_docker//cc:image.bzl", "cc_image")
load("//bazel:pl_build_system.bzl", "pl_cc_binary", "pl_cc_test_library")

package(default_visibility = ["//src/stirling/obj_tools:__subpackages__"])

pl_cc_binary(
    name = "vaddr_convert_self_func",
    srcs = ["vaddr_convert_self_func.cc"],
    deps = [
        "//src/stirling/obj_tools:cc_library",
    ],
)

cc_image(
    name = "vaddr_convert_self_func_image",
    base = "//:pl_cc_base_debug_image",
    binary = ":vaddr_convert_self_func",
)

pl_cc_test_library(
    name = "vaddr_convert_self_func_container",
    srcs = glob(
        ["*.cc"],
        exclude = [
            "vaddr_convert_self_func.cc",
        ],
    ),
    hdrs = glob(
        [
            "*.h",
        ],
    ),
    data = [
        ":vaddr_convert_self_func_image.tar",
    ],
    deps = ["//src/common/testing/test_utils:cc_library"],
)
